<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        html{
            border: 1px solid #00ff00;
        }
        body{
            border: 1px solid #62B5EC;
        }
        div{
            width: 100px;
            height: 100px;
            border: 1px solid red;
        }
        #d1{
            /*设置绝对定位 元素脱离文档流 后面的元素会顶上来*/
            position: absolute;
            /*通过left/right/top/bottom相对于窗口(html)控制元素位置*/
            right:30px;
            top:20px;
        }
        #big{
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 100px 0 0 100px;
        }
        #big>div{
            background-color: blue;
            margin: 50px;
            /*设置相对定位 做参照物*/
            position: relative;
        }
        #big>div>div{
            width: 50px;
            height: 50px;
            background-color: green;
            position: absolute;
            left: 0;
            top:0;
        }

    </style>
</head>
<body>
<div id="d1">div1</div>
<div id="big">
    <div>
        <div></div>
    </div>
</div>
<div id="d2">div2</div>
<div id="d3">div3</div>
</body>
</html>